package com.mmm.station;

import com.mmm.station.filter.AccessFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

@EnableZuulProxy
@SpringCloudApplication
public class UserApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserApiApplication.class, args);
    }

    @Bean
    public AccessFilter accessFilter() {
        return new AccessFilter();
    }
}

/*
 @SpringCloudApplication 注解，之前没有提过，通过源码我们看到，
 它整合了 @SpringBootApplication 、 @EnableDiscoveryClient 、 @EnableCircuitBreaker ，
 主要目的还是简化配置
*/